<?php
//实例 (MySQLi 面向对象)创建表格
	header("Content-type:text/html;charset=utf-8");
    date_default_timezone_set("Asia/Shanghai");
    echo date('Y-m-d H:i:s',strtotime('now'));
    echo "<br/>";
    $servername = "localhost:3306";
    $username = "root";
    $password = "123456";
    $dbname = "group7";
    // 创建连接
    $conn = new mysqli($servername, $username, $password, $dbname);
    // 检测连接
    if ($conn->connect_error) {
        die("连接失败: " . $conn->connect_error);
    } 
    // 使用 sql 创建数据表MyGuests
    $sql = "CREATE TABLE user_zjj (
	id  int(10) NOT NULL AUTO_INCREMENT ,
	username_zjj  varchar(255) CHARACTER SET utf8 NULL ,
	password_zjj  varchar(255) CHARACTER SET utf8 NULL ,
	phone_zjj  varchar(15) CHARACTER SET utf8 NULL ,
	email_zjj  varchar(50) CHARACTER SET utf8 NULL ,
	PRIMARY KEY (id)
	)";
	$sql1 = "CREATE TABLE user_hyh (
id  int(10) NOT NULL AUTO_INCREMENT ,
username_hyh  varchar(255) CHARACTER SET utf8 NULL ,
password_hyh  varchar(255) CHARACTER SET utf8 NULL ,
phone_hyh  varchar(15) CHARACTER SET utf8 NULL ,
email_hyh  varchar(50) CHARACTER SET utf8 NULL ,
PRIMARY KEY (id)
)";
    $sql2 = "CREATE TABLE user_lkk (
id  int(10) NOT NULL AUTO_INCREMENT ,
username_lkk  varchar(255) CHARACTER SET utf8 NULL ,
password_lkk  varchar(255) CHARACTER SET utf8 NULL ,
phone_lkk  varchar(15) CHARACTER SET utf8 NULL ,
email_lkk  varchar(50) CHARACTER SET utf8 NULL ,
PRIMARY KEY (id)
)";
	$sql3 = "CREATE TABLE user_xsj (
id  int(10) NOT NULL AUTO_INCREMENT ,
username_xsj  varchar(255) CHARACTER SET utf8 NULL ,
password_xsj  varchar(255) CHARACTER SET utf8 NULL ,
phone_xsj  varchar(15) CHARACTER SET utf8 NULL ,
email_xsj  varchar(50) CHARACTER SET utf8 NULL ,
PRIMARY KEY (id)
)";
	$sql4 = "CREATE TABLE user_zbw (
id  int(10) NOT NULL AUTO_INCREMENT ,
username_zbw  varchar(255) CHARACTER SET utf8 NULL ,
password_zbw  varchar(255) CHARACTER SET utf8 NULL ,
phone_zbw  varchar(15) CHARACTER SET utf8 NULL ,
email_zbw  varchar(50) CHARACTER SET utf8 NULL ,
PRIMARY KEY (id)
)";
    $sql5 = "CREATE TABLE user_zww (
id  int(10) NOT NULL AUTO_INCREMENT ,
username_zww  varchar(255) CHARACTER SET utf8 NULL ,
password_zww  varchar(255) CHARACTER SET utf8 NULL ,
phone_zww  varchar(15) CHARACTER SET utf8 NULL ,
email_zww  varchar(50) CHARACTER SET utf8 NULL ,
PRIMARY KEY (id)
)";
    $sql6 = "CREATE TABLE user_yzm (
id  int(10) NOT NULL AUTO_INCREMENT ,
username_yzm  varchar(255) CHARACTER SET utf8 NULL ,
password_yzm  varchar(255) CHARACTER SET utf8 NULL ,
phone_yzm  varchar(15) CHARACTER SET utf8 NULL ,
email_yzm  varchar(50) CHARACTER SET utf8 NULL ,
PRIMARY KEY (id)
)";
	
    echo "<mark>";
    if (($conn->query($sql)&&$conn->query($sql1)&&$conn->query($sql2)
    &&$conn->query($sql3)&&$conn->query($sql4)&&$conn->query($sql5)
    &&$conn->query($sql6)) === TRUE) {
        echo "Table MyGuests created successfully";
    } else {
        echo "创建数据表错误: " . $conn->error;
    }echo "</mark>";
    //连接
    $conn->close();
?>